import java.util.Arrays;

public class Test14 {
    public static void main(String[] args) {
        double[] arr = {8.0,9.9,9.0,8.9,9.2};
        double max = arr[0];
        double min = arr[0];
        double[] arr_new1 = new double[3];
        int index= 0;
        for (int i = 1; i < arr.length; i++) {
            if (max<arr[i]){
                max = arr[i];
            }
        }
        for (int i = 1; i < arr.length; i++) {
            if (min>arr[i]){
                min = arr[i];
            }
        }
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] != max) {
                if(arr[i] != min){
                arr_new1[index] = arr[i];
                index++;
            }
        }

        // 打印新数组
        System.out.println("删除后的数组：" + Arrays.toString(arr_new1));
    }
    }
}
